﻿using System.Collections.Generic;
using System.Xml.Linq;

namespace Rampant.Muninn
{
    public class RssItem : RssElement
    {
        public RssItem(XElement itemSource): base(itemSource){ }
        //RSS 2.0 Specification states: 
        //All Item elements are optional, but either Title or Description must be specified.
        public RssElement Title { get { return GetElement("item", "title"); } }
        public RssElement Description { get { return GetElement("item", "description"); } }
        //Optional:
        public RssElement Link { get { return GetElement("item", "link"); } }
        public RssElement Author { get { return GetElement("item", "author"); } }
        public List<RssElement> Categories { get { return GetElements("item", "category"); } }
        public RssElement Comments { get { return GetElement("item", "comments"); } }
        public RssElement Enclosure { get { return GetElement("item", "enclosure"); } }
        public RssElement Guid { get { return GetElement("item", "guid"); } }
        public RssElement PubDate { get { return GetElement("item", "pubDate"); } }
        public RssElement Source { get { return GetElement("item", "source"); } }
    }
}
